home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / libs / pdcurs21 / private / _getattr.c < prev    next >
C/C++ Source or Header  |  1993-06-18  |  2KB  |  66 lines

  1. #define    CURSES_LIBRARY    1
  2. #include <curses.h>
  3.  
  4. #ifdef PDCDEBUG
  5. char *rcsid__getattr = "$Header: C:\CURSES\private\RCS\_getattr.c 2.1 1993/06/18 20:23:23 MH Rel MH $";
  6. #endif
  7.  
  8.  
  9.  
  10.  
  11. /*man-start*********************************************************************
  12.  
  13.   PDC_get_attribute()    - Get attribute at current cursor
  14.  
  15.   PDCurses Description:
  16.      This is a private PDCurses function
  17.  
  18.      Return the current attr at current cursor position on the screen.
  19.  
  20.   PDCurses Return Value:
  21.      This routine will return OK upon success and otherwise ERR will be
  22.      returned.
  23.  
  24.   PDCurses Errors:
  25.      There are no defined errors for this routine.
  26.  
  27.   Portability:
  28.      PDCurses    int    PDC_get_attribute( void );
  29.  
  30. **man-end**********************************************************************/
  31.  
  32. int    PDC_get_attribute(void)
  33. {
  34. #ifdef    OS2
  35.     char Cell[4];
  36.     USHORT cellLen = 2;
  37.     USHORT curRow = PDC_get_cur_row();
  38.     USHORT curCol = PDC_get_cur_col();
  39. #endif
  40.  
  41. #ifdef PDCDEBUG
  42.     if (trace_on) PDC_debug("PDC_get_attribute() - called\n");
  43. #endif
  44.  
  45. #ifdef    FLEXOS
  46.     /* Get and return current attribute.  Force error until fixed. */
  47.     return ((COLOR_CYAN) >> ((sizeof(ch type) / 2) * 8));
  48. #endif
  49.  
  50. #ifdef    DOS
  51.     regs.x.ax = 0x0800;
  52.     regs.h.bh = _cursvar.video_page;
  53.     int86(0x10, ®s, ®s);
  54.     return ((int) regs.h.ah);
  55. #endif
  56.  
  57. #ifdef    OS2
  58.     VioReadCellStr((PCH)&Cell, (PUSHORT)&cellLen, (USHORT)curRow, (USHORT)curCol, 0);
  59.     return ((int) Cell[1]);
  60. #endif
  61.  
  62. #ifdef UNIX
  63. /* INCOMPLETE */
  64. #endif
  65. }
  66.